<?php
/*
	监听电商客商品添加事件
	添加防伪商品
*/
defined('BY_JYA') or exit('error');
return true;
$goodsid=$event['goodsid'];
$goods=pdo_get('jy_weishop_goods',array('id'=>$goodsid),array('title','image','price','subtitle'));
$goods['content']=$goods['subtitle'];
unset($goods['subtitle']);
$sec_goods_id=$this->pdo_getcolumn('goods',array('shop_goods_id'=>$goodsid),'sec_goods_id');
if(empty($sec_goods_id)){
	$sec_goods_id=model('jy_security/goods')->add($goods);
	$insert=array(
		'uniacid'=>$_SESSION['uniacid'],
		'shop_goods_id'=>$goodsid,
		'sec_goods_id'=>$sec_goods_id
	);
	$this->pdo_insert('goods',$insert);
}else{
	model('jy_security/goods')->update($sec_goods_id,$goods);	
}

return true;